package com.dongwu.manager.dao;


import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.dongwu.common.dao.BaseDao;
import com.dongwu.manager.entity.Device;

@Repository
public interface DeviceDao  extends BaseDao<Device, String> {
	
	List<Device> findBySn(String sn);

	Device findById(String id);
//
//	Device save(Device device);
	
	@Query(value="select count(*) from device where userid = ?1", nativeQuery=true)//原生sql语句
	public Long countByUserid(String userid);
}
